// UEXDataManager.h: interface for the UEXDataManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_UEXDATAMANAGER_H__414AE2B4_F593_4515_AAE6_B0175B44DF77__INCLUDED_)
#define AFX_UEXDATAMANAGER_H__414AE2B4_F593_4515_AAE6_B0175B44DF77__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "UEXData.h"
#include "ManagerTemplate.h"

class AFX_EXT_CLASS UEXDataManager : public ManagerTemplate<CString, UEXData>
{
public:
	UEXDataManager(const CString& strHandle, BOOL bCreate = FALSE, AcDbDatabase* pDB = NULL);
	UEXDataManager(const AcDbHandle& handle, BOOL bCreate = FALSE, AcDbDatabase* pDB = NULL);
	virtual ~UEXDataManager();

public:
	UEXData* GetUEXData(const CString& strName);
	BOOL ReadUEXData();
	BOOL WriteUEXData();

private:
	BOOL ParseResbuf(struct resbuf* pRb);
	resbuf* ConstructResList(CArray<resbuf*, resbuf*>& pos);
	void ExtractResList(const CArray<resbuf*, resbuf*>& pos);
	UEXData* NewUEXData(const CString& strName);

private:
	AcDbDatabase* m_pDB;
	AcDbHandle m_handle;
	BOOL m_bCreate;
};

#endif // !defined(AFX_UEXDATAMANAGER_H__414AE2B4_F593_4515_AAE6_B0175B44DF77__INCLUDED_)
